package com.lanswon.qzsmk.util.inventoryUtil;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import ch.qos.logback.classic.Logger;

@Component
public class DateAndStampUtil {
	
	private static Logger logger = (Logger) LoggerFactory.getLogger(DateAndStampUtil.class);
	
	public static String getCurrentDate() {
		logger.info("getCurrentDate#########start()");
		Date date = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
		String currentDateString = sdf.format(date);
		logger.debug("当前的日期为==>"+currentDateString);
		logger.info("getCurrentDate#########end()");
		return currentDateString;
	}
	
	public static String getCurrentStamp() {
		logger.info("getCurrentStamp#########start()");
		Date date = new Date();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
		String currentDateString = sdf.format(date);
		logger.debug("当前的时间戳为==>"+currentDateString);
		logger.info("getCurrentStamp#########end()");
		return currentDateString;
	}
}
